package com.sea.app.common.kit.signature;

import com.sea.app.common.excrption.SystemException;

import java.security.NoSuchAlgorithmException;

/**
 * Created by 31417 on 2017/4/9.
 */
public class MD5 {

    public static byte[] compute(byte[] data) {
        java.security.MessageDigest md = null;
        try {
            md = java.security.MessageDigest.getInstance("MD5");
        } catch (NoSuchAlgorithmException e) {
            e.printStackTrace();
            throw SystemException.on(e);
        }
        md.update(data);
        return md.digest();
    }
}
